Optimal. Leaf size=37 \[ 2 \sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a+b \cos (x)}}{\sqrt {a}}\right )-2 \sqrt {a+b \cos (x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 37, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {2800, 52, 65,
213} \begin {gather*} 2 \sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a+b \cos (x)}}{\sqrt {a}}\right )-2 \sqrt {a+b \cos (x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 52
Rule 65
Rule 213
Rule 2800
Rubi steps
\begin {align*} \int \sqrt {a+b \cos (x)} \tan (x) \, dx &=-\text {Subst}\left (\int \frac {\sqrt {a+x}}{x} \, dx,x,b \cos (x)\right )\\ &=-2 \sqrt {a+b \cos (x)}-a \text {Subst}\left (\int \frac {1}{x \sqrt {a+x}} \, dx,x,b \cos (x)\right )\\ &=-2 \sqrt {a+b \cos (x)}-(2 a) \text {Subst}\left (\int \frac {1}{-a+x^2} \, dx,x,\sqrt {a+b \cos (x)}\right )\\ &=2 \sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a+b \cos (x)}}{\sqrt {a}}\right )-2 \sqrt {a+b \cos (x)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 37, normalized size = 1.00 \begin {gather*} 2 \sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a+b \cos (x)}}{\sqrt {a}}\right )-2 \sqrt {a+b \cos (x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.09, size = 30, normalized size = 0.81
method | result | size |
derivativedivides | \(2 \arctanh \left (\frac {\sqrt {a +b \cos \left (x \right )}}{\sqrt {a}}\right ) \sqrt {a}-2 \sqrt {a +b \cos \left (x \right )}\) | \(30\) |
default | \(2 \arctanh \left (\frac {\sqrt {a +b \cos \left (x \right )}}{\sqrt {a}}\right ) \sqrt {a}-2 \sqrt {a +b \cos \left (x \right )}\) | \(30\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 46, normalized size = 1.24 \begin {gather*} -\sqrt {a} \log \left (\frac {\sqrt {b \cos \left (x\right ) + a} - \sqrt {a}}{\sqrt {b \cos \left (x\right ) + a} + \sqrt {a}}\right ) - 2 \, \sqrt {b \cos \left (x\right ) + a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.72, size = 109, normalized size = 2.95 \begin {gather*} \left [\frac {1}{2} \, \sqrt {a} \log \left (-\frac {b^{2} \cos \left (x\right )^{2} + 8 \, a b \cos \left (x\right ) + 4 \, {\left (b \cos \left (x\right ) + 2 \, a\right )} \sqrt {b \cos \left (x\right ) + a} \sqrt {a} + 8 \, a^{2}}{\cos \left (x\right )^{2}}\right ) - 2 \, \sqrt {b \cos \left (x\right ) + a}, -\sqrt {-a} \arctan \left (\frac {2 \, \sqrt {b \cos \left (x\right ) + a} \sqrt {-a}}{b \cos \left (x\right ) + 2 \, a}\right ) - 2 \, \sqrt {b \cos \left (x\right ) + a}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {a + b \cos {\left (x \right )}} \tan {\left (x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.55, size = 34, normalized size = 0.92 \begin {gather*} -\frac {2 \, a \arctan \left (\frac {\sqrt {b \cos \left (x\right ) + a}}{\sqrt {-a}}\right )}{\sqrt {-a}} - 2 \, \sqrt {b \cos \left (x\right ) + a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.03 \begin {gather*} \int \mathrm {tan}\left (x\right )\,\sqrt {a+b\,\cos \left (x\right )} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________